/*
 * Created on Feb 7, 2008
 *
 * TODO To change the template for this generated file go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
package org.phalanx.server.net;

import org.jivesoftware.smack.Chat;
import org.jivesoftware.smack.MessageListener;
import org.jivesoftware.smack.XMPPConnection;
import org.jivesoftware.smack.XMPPException;
import org.jivesoftware.smack.packet.Message;
import org.xml.sax.*;

/**
 * @author sday
 *
 * TODO To change the template for this generated type comment go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
public class xmppTest {

	public static void main(String[] args) {

		XMPPConnection connection = new XMPPConnection("xmpp.bluefishtech.net");

		try {
			connection.connect();
			connection.login("tester@bluefishtech.net","fuckoff");
			if (connection.isAuthenticated()){

				
				Chat chat = connection.getChatManager().createChat("tester@bluefishtech.net", new MessageListener() {
				
					public void processMessage(Chat chat, Message message) {
						System.out.println("Received message: " + message);
					}
				});

				
				chat.sendMessage("Hello this is a  test");
			}
		} catch (XMPPException xe){
			System.out.println("Error Connecting");
		}
	}
}
